package com.yunbao.ioc.tx;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by louisyuu on 2020/3/4 下午2:55
 */
public class TransactionCglibAdvisor extends TransactionAdvisor implements MethodInterceptor {

    public TransactionCglibAdvisor(TransactionManager transactionManager, Object target) {
        super(transactionManager, target);
    }

    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        return invoke(method,objects);
    }
}
